import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: LoginView
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/User/RegisterView.vue')
    },
    {
      path: '/Index',
      name: 'Index',
      component: () => import('../views/IndexView.vue'),
      children: [
        {
          path: '/CheJian',
          name: 'CheJian',
          component: () => import('../views/BaseData/CheJian.vue'),
        },
        {
          path: '/process-maintenance',
          name: 'processMaintenance',
          component: () => import('../views/ProcessMaintenances/ProcessMaintenanceView.vue'),
        },
        {
          path: '/process-route',
          name: 'processRoute',
          component: () => import('../views/ProcessMaintenances/Processroute.vue'),
        },
        {
          path: '/qualitytypeView',
          name: 'qualitytypeView',
          component: () => import('../views/QualityManagement.vue/qualitytypeView.vue'),
        },
        {
          path: '/qualityproject',
          name: 'qualityproject',
          component: () => import('../views/QualityManagement.vue/qualityprojectView.vue'),
        },
        {
          path: '/qualitydesign',
          name: 'qualitydesign',
          component: () => import('../views/QualityManagement.vue/qualitydesign.vue'),
        },
        {
          path: '/qualitytask',
          name: 'qualitytask',
          component: () => import('../views/QualityManagement.vue/qualitytask.vue'),
        },
        {
          path: '/qualitymaterials',
          name: 'qualitymaterials',
          component: () => import('../views/QualityManagement.vue/qualitymaterials.vue'),
        },
        {
          path: '/qualityproduct',
          name: 'qualityproduct',
          component: () => import('../views/QualityManagement.vue/QualityProductView.vue'),
        },
        {
          path: '/GetUser',
          name: 'GetUser',
          component: () => import('../views/UserInfor/GetUserView.vue'),
        },
        {
          path: '/ChanXian',
          name: 'ChanXian',
          component: () => import('../views/BaseData/ChanXian.vue'),
        },
        {
          path: '/Customer',
          name: 'Customer',
          component: () => import('../views/BaseData/Customer.vue'),
        },
        {
          path: '/GetRole',
          name: 'GetRole',
          component: () => import('../views/UserInfor/GetRoleView.vue'),
        },
        {
          path: '/GetLoginLogger',
          name: 'GetLoginLogger',
          component: () => import('../views/UserInfor/GetLoginLoggerView.vue'),
        },
        // 在 Index 路由的 children 数组中添加以下代码
        {
          path: '/Supplier',
          name: 'Supplier',
          component: () => import('../views/BaseData/Supplier.vue')
        },
        {
          path: '/CangWei',
          name: 'CangWei',
          component: () => import('../views/BaseData/CangWei.vue'),
        },
        {
          path: '/NewCangKu',
          name: 'NewCangKu',
          component: () => import('../views/BaseData/NewCangKu.vue'),
        },
        {
          path: '/MaterialGroup',
          name: 'MaterialGroup',
          component: () => import('../views/BaseData/MaterialGroup.vue'),
        },
        {
          path: '/MaterialProduct',
          name: 'MaterialProduct',
          component: () => import('../views/BaseData/MaterialProduct.vue'),
        },
        // 添加BOM路由
        {
          path: '/bom',
          name: 'BOM',
          component: () => import('../views/BaseData/BOM.vue'),
        },
        // 添加仓库管理路由
        {
          path: '/CangKu',
          name: 'CangKu',
          component: () => import('../views/BaseData/CangKu.vue'),
        },
        {
          path: '/GetOrcan',
          name: 'GetOrcan',
          component: () => import('../views/UserInfor/GetOrcanView.vue'),
        },
        // {
        //   path: '/draws',
        //   name: 'draws',
        //   component: () => import('../views/registerNode/draw.vue'),
        // },
        {
          path: '/Prdu',
          name: 'Prdu',
          component: () => import('../views/Production/ProduView.vue'),
        },
        {
          path: '/Factorysa',
          name: 'Factorysa',
          component: () => import('../views/UserInfor/GetFactory/GetFactorysView.vue'),
        },
        {
          path: '/WorkOrder',
          name: 'WorkOrder',
          component: () => import('../views/Production/WorkOrderView.vue'),
        },
        {
          path: '/WorkReportView',
          name: 'WorkReportView',
          component: () => import('../views/Production/WorkReportView.vue'),
        },
        {
          path: '/GeneratePlan',
          name: 'GeneratePlan',
          component: () => import('../views/GeneratePlan/GeneratePlanView.vue'),
        },
        {
          path: '/Calendar',
          name: 'Calendar',
          component: () => import('@/views/Production/CalendarView.vue'),
        },
        {
          path: '/Water',
          name: 'Water',
          component: () => import('../views/Production/WaterView.vue'),
        },
        // AI智能客服路由
        {
          path: '/ai-customer-service',
          name: 'IntelligentCustomerService',
          component: () => import('../views/AISHow/IntelligentCustomerServiceNew.vue'),
        },
        //DashboardView
        {
          path: '/DashboardView',
          name: 'DashboardView',
          component: () => import('../views/BaseData/DashboardView.vue'),
        },
        // ScannerView
        {
          path: '/ScannerView',
          name: 'ScannerView',
          component: () => import('../views/BaseData/ScannerView.vue')
        },
        // SalesInvoice Add
        {
          path: '/SalesInvoice/Add',
          name: 'SalesInvoiceAdd',
          component: () => import('../views/SalesInvoice/SalesInvoiceAdd.vue')
        },
        // SalesInvoice List
        {
          path: '/SalesInvoice',
          name: 'SalesInvoiceList',
          component: () => import('../views/SalesInvoice/SalesInvoiceList.vue')
        },
        // SalesInvoice Edit
        {
          path: '/SalesInvoice/Edit/:id',
          name: 'SalesInvoiceEdit',
          component: () => import('../views/SalesInvoice/SalesInvoiceEdit.vue')
        },
        {
          path: '/ShenchanInfo',
          name: 'ShenchanInfo',
          component: () => import('../views/Production/ShenchanInfoView.vue')
        },
        {
          path: '/CangKuFenPei',
          name: 'CangKuFenPei',
          component: () => import('../views/BaseData/CangKuFenPei.vue')
        },
        {
          path: '/ChuKu',
          name: 'ChuKu',
          component: () => import('../views/BaseData/ChuKu.vue')
        },
        {
          path: '/InvoiceAdd',
          name: 'InvoiceAdd',
          component: () => import('../views/SalesInvoice/InvoiceReceiptAdd.vue')
        },
        { path: '/InvoiceList', name: 'InvoiceList', component: () => import('../views/SalesInvoice/InvoiceReceiptList.vue') }, { path: '/InvoiceEdit/:receiptId', name: 'InvoiceEdit', component: () => import('../views/SalesInvoice/InvoiceReceiptEdit.vue') },],
      // ChuKu

    },
  ],
})


export default router
